import requests
headers ={
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36'
}
url = 'https://movie.douban.com/top250'
response = requests.get(url=url,headers=headers)
with open(file='豆瓣250.html', mode='w', encoding='utf-8') as f:

    print(response.text)
    f.write(response.text)






